﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Estimate.Common.DataFileValidator
{
    public class DataFileValidatorFactory
    {
        public IDataFileValidator NormalCityForeValidator()
        {
            return new NormalCityForeValidator();
        }

        public IDataFileValidator RainForeValidator()
        {
            return new RainForeValidator();
        }

        public IDataFileValidator SdxCityForeValidator()
        {
            return new SdxCityForeValidator();
        }

        public IDataFileValidator SiteForeValidator()
        {
            return new SiteForeValidator();
        }

        public IDataFileValidator ZytCityForeValidator()
        {
            return new ZytCityForeValidator();
        }

        public IDataFileValidator GetValidatorByFileName(string filename)
        {
            //RS
            //PR
            //cz   pbb
            if (filename.Substring(0, 2) == "RS")
            {
                return SiteForeValidator();
            }
            else if (filename.Substring(0, 2) == "PR")
            {
                return RainForeValidator();
            }
        //else if (filename.Substring(filename.IndexOf('.') + 1) == "pbb")
        //{
        //    //if( filename.Substring(0,2) == "cz")  cz排班表

        //    }
            else return NormalCityForeValidator();

        }
    }
}
